home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14356 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.5 KB  |  55 lines

  1. Path: pop.gnn.com!BMette
  2. From: BMette@gnn.com (Bret)
  3. Newsgroups: comp.lang.c++
  4. Subject: record
  5. Date: Fri, 29 Mar 1996 18:18:01
  6. Organization: none
  7. Sender: BMette@gnn.com (none) (from www-12-223.gnn.com. 205.188.12.223)
  8. Message-ID: <4jhr5v$6dg@news-e2b.gnn.com>
  9. NNTP-Posting-Host: www-12-223.gnn.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset="us-ascii"
  12. X-GNN-NewsServer-Posting-Date: 29 Mar 1996 23:19:27 GMT
  13. X-Mailer: GNNmessenger 1.2
  14.  
  15. How do I send a 'record' to a file?
  16.     I am using...
  17.  
  18. struct application {
  19.            char name[24];
  20.            char handle[24];
  21.            char phone[24];
  22.            char address[24];
  23.            char city[24];
  24.            char state[24];
  25.            char country[24];
  26.            char position[24];
  27.            char affils[24];
  28.            char why_left[24];
  29.            char best[24];
  30.            char formats[24];
  31.            char lang[24];} app;
  32.  
  33. and
  34.  
  35. handle = open("DOA_APP.TXT", O_CREAT | O_RDWR | O_TEXT);
  36.    write(handle, app.name, 24);
  37.    write(handle, app.handle, 24);
  38.    write(handle, app.phone, 24);
  39.    write(handle, app.address, 24);
  40.    write(handle, app.city, 24);
  41.    write(handle, app.state, 24);
  42.    write(handle, app.country, 24);
  43.    write(handle, app.position, 24);
  44.    write(handle, app.affils, 24);
  45.    write(handle, app.why_left, 24);
  46.    write(handle, app.best, 24);
  47.    write(handle, app.formats, 24);
  48.    write(handle, app.lang, 24);
  49.    close(handle);
  50.  
  51. but i want to just put it all at once...
  52.     if i cannot put it all at once how do i place line breaks 
  53. after each line?
  54.  
  55.